package net.zoneland.knowledge.dao;

import java.util.List;
import net.zoneland.knowledge.model.HotQueAndSearch;
import net.zoneland.knowledge.model.HotQueAndSearchExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface HotQueAndSearchMapper {
    @SelectProvider(type=HotQueAndSearchSqlProvider.class, method="countByExample")
    long countByExample(HotQueAndSearchExample example);

    @Insert({
        "insert into AITK_HOTQUE_SEARCH (CATEGORY, CONFIGURATIONTYPE, ",
        "SORT, QUENAME, CREATORNAME, ",
        "CREATETIME, ID, ",
        "REMARK, ORGDN)",
        "values (#{category,jdbcType=VARCHAR}, #{configurationType,jdbcType=VARCHAR}, ",
        "#{sort,jdbcType=DECIMAL}, #{queName,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{id,jdbcType=VARCHAR}, ",
        "#{remark,jdbcType=VARCHAR}, #{orgDn,jdbcType=VARCHAR})"
    })
    int insert(HotQueAndSearch record);

    @InsertProvider(type=HotQueAndSearchSqlProvider.class, method="insertSelective")
    int insertSelective(HotQueAndSearch record);

    @SelectProvider(type=HotQueAndSearchSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="CATEGORY", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="CONFIGURATIONTYPE", property="configurationType", jdbcType=JdbcType.VARCHAR),
        @Result(column="SORT", property="sort", jdbcType=JdbcType.DECIMAL),
        @Result(column="QUENAME", property="queName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATORNAME", property="creatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATETIME", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ID", property="id", jdbcType=JdbcType.VARCHAR),
        @Result(column="REMARK", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="ORGDN", property="orgDn", jdbcType=JdbcType.VARCHAR)
    })
    List<HotQueAndSearch> selectByExample(HotQueAndSearchExample example);

    @UpdateProvider(type=HotQueAndSearchSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HotQueAndSearch record, @Param("example") HotQueAndSearchExample example);

    @UpdateProvider(type=HotQueAndSearchSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HotQueAndSearch record, @Param("example") HotQueAndSearchExample example);
}